#欢迎使用防熊函数，作者:DrSmooth esay_peace 版本号:正式版1.0
#步骤: 进入游戏→安装文件到datapacks→修改设置并保存→在游戏中输入/reload→重启游戏→成功！【注意：创世神mod会因为/reload执行后失效】
#公告设置请打开data\common\functions\notice.mcfunction  功能设置请打开data\function\functions\function 【请仔细按照提示信息进行安装】
#标签移除和规则设置
tag @a remove tnt
tag @a remove crystal
tag @a remove anchor
tag @a remove tntcart
tag @a remove tntq
tag @a remove tntcartq
tag @a remove tntbomb
tag @a remove grindstone
tag @a remove lava
tag @a remove cb
gamerule doMobSpawning false
gamerule doFireTick false
gamerule keepInventory true
#TNT
execute as @a[nbt={Inventory:[{id:"minecraft:tnt"}]},tag=!whitelist] run tag @s add tnt
execute as @a[tag=tnt] run function common:tnt
execute as @a[nbt={Inventory:[{id:"minecraft:tnt_minecart"}]},tag=!whitelist] run tag @s add tntcart
execute as @a[tag=tntcart] run function common:tntcart
execute at @e[type=item,nbt={Item:{id:"minecraft:tnt"}}] as @a[tag=!whitelist,distance=..5] run tag @s add tntq
execute as @a[tag=tntq] run function common:tntq
execute at @e[type=item,nbt={Item:{id:"minecraft:tnt_minecart"}}] as @a[tag=!whitelist,distance=..5] run tag @s add tntcartq
execute as @a[tag=tntcartq] run function common:tntcartq
execute at @e[type=tnt] as @a[distance=..10] run tag @s add tntbomb
execute as @a[tag=tntbomb] run function common:tntbomb
#末影水晶
execute as @a[nbt={Inventory:[{id:"minecraft:end_crystal"}]},tag=!whitelist] run tag @s add crystal
execute as @a[tag=crystal] run function common:crystal
execute as @e[type=end_crystal] run tellraw @a [{"text": "[","color": "aqua"},{"text": "Technetium","color": "gold"},{"text": "]","color": "aqua"},{"text":" 有末影水晶实体生成,附近玩家为:","color":"red","bold":true},{"selector":"@p","color":"white","bold":true}]
kill @e[type=end_crystal]
#重生锚
execute as @a[nbt={Inventory:[{id:"minecraft:respawn_anchor"}]},tag=!whitelist] run tag @s add anchor
execute at @e[type=item,nbt={Item:{id:"minecraft:respawn_anchor"}}] as @a[tag=!whitelist,distance=..5] run tag @s add anchor
execute as @a[tag=anchor] run function common:anchor
kill @e[type=item,nbt={Item:{id:"minecraft:respawn_anchor"}}]
#砂轮
execute as @a[nbt={Inventory:[{id:"minecraft:grindstone"}]},tag=!whitelist] run tag @s add grindstone
execute as @a[scores={grindstone=1}] run function common:grindstone
#岩浆
execute as @a[tag=!whitelist,nbt={Inventory:[{id:"minecraft:lava_bucket"}]}] run tag @s add lava
execute as @e[type=item,nbt={Item:{id:"minecraft:lava_bucket"}}] as @a[tag=!whitelist,distance=..5] run tag @s add lava
execute as @a[tag=lava] run function common:lava
#发射器
execute as @a[tag=!rs_allow,nbt={Inventory:[{id:"minecraft:dispenser"}]}] run tellraw @a [{"text": "[","color": "aqua"},{"text": "Technetium","color": "gold"},{"text": "]","color": "aqua"},{"selector":"@s","color":"aqua"},{"text":" 想要使用发射器","color":"red"}]
clear @a[tag=!rs_allow] dispenser
#烟花实体
execute as @e[type=wither] run tellraw @a [{"text": "[","color": "aqua"},{"text": "Technetium","color": "gold"},{"text": "]","color": "aqua"},{"text":"发现凋零,附近玩家为","color":"red","bold":true},{"selector":"@p","color":"white","bold":true}]
execute as @e[type=firework_rocket,nbt={FireworksItem:{tag:{Fireworks:{}}}}] run tellraw @a [{"text": "[","color": "aqua"},{"text": "Technetium","color": "gold"},{"text": "]","color": "aqua"},{"text":" 发现携带nbt的烟花,附近玩家为","color":"red","bold":true},{"selector":"@p","color":"white","bold":true}]
kill @e[type=wither]
kill @e[type=firework_rocket]

